package cn.bingoogolapple.bgabanner;

import ohos.agp.components.AttrSet;
import ohos.agp.components.Component;
import ohos.app.Context;
import ohos.multimodalinput.event.TouchEvent;

/**
 * 作者:王浩 邮件:bingoogolapple@gmail.com
 * 创建时间:15/6/19 11:23
 * 描述:继承ViewPager，通过反射方式实现支持低版本上切换动画
 */
public class BGAViewPager extends PageSliders implements Component.TouchEventListener {
    /**
     * constructor
     *
     * @param context
     */
    public BGAViewPager(Context context) {
        super(context);
    }

    /**
     * constructor
     *
     * @param context
     * @param attrSet
     */
    public BGAViewPager(Context context, AttrSet attrSet) {
        super(context, attrSet);
        setTouchEventListener(this);
    }

    /**
     * constructor
     *
     * @param context
     * @param attrSet
     * @param styleName
     */
    public BGAViewPager(Context context, AttrSet attrSet, String styleName) {
        super(context, attrSet, styleName);
        setTouchEventListener(this);
    }

    @Override
    public boolean onTouchEvent(Component component, TouchEvent touchEvent) {
        return true;
    }

    public interface AutoPlayDelegate {
        /**
         * handleAutoPlayActionUpOrCancel
         *
         * @param xVelocity
         */
        void handleAutoPlayActionUpOrCancel(float xVelocity);
    }
}